<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>
    <div id="app">
        <!-- 控制元素是否展示 -->

        <!--
            v-show
            修改display是否为none
        -->
        <div v-show="showBol">v-show控制的div</div>

        <!--
            v-if
            控制dom节点是否挂载
        -->
        <div v-if="ifBol">v-if控制的div</div>

        <div v-for="item in arr" v-show="item < 3">{{item}}</div>

        <button @click="btnClick">click</button>
    </div>

    <script src="./vue.js"></script>
    <script>
        // 数据驱动
        let myApp = new Vue({
            el: '#app',
            data: {
                showBol: true,
                ifBol: true,
                arr: [1,2,3,4,5]
            },
            methods: {
                // btnClick () {
                //     console.log(this.arr)
                // }
                btnClick: function () {
                    console.log(this.arr)
                }
            }
        })
    </script>
</body>
</html>